package com.ken.zeratul.dlock.lock.base;

import com.ken.zeratul.dlock.annotation.DLockType;

/**
 * 分布式锁抽象类
 */
public abstract class BaseDLock {

    /**
     * 阻塞式加锁
     * @param dLockType
     * @param key
     */
    public abstract void lock(DLockType dLockType, String key);

    /**
     * 非阻塞式加锁
     */
    public abstract boolean tryLock(DLockType dLockType, String key, Integer timeout);

    /**
     * 解锁
     */
    public abstract void unlock();
}
